<%--
  Created by IntelliJ IDEA.
  User: Procedure
  Date: 2017/5/16
  Time: 14:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/WEB-INF/template/common/taglibs.jspf" %>
<es:contentHeader/>
<title>修改用户密码</title>
<t:base type="cloudAdmin,fontAwesome,jquery,bootstrap,jqueryUI,animate,uniform,select2,datePicker,common,layer,jqueryValidate"></t:base>

<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/resources/css/tdjkc.css" />
<style>
    .error {
        padding-left: 2px;
        padding-bottom: 2px;
        color: #EA5200;
    }
</style>
<script type="text/javascript">
    $().ready(function() {
        $("#editForm").validate({
            rules: {
                password:{
                    required: true,
                    equalTo: "#newPassword",

                },
                newPassword:{
                    required: true,
                    maxlength:20,
                    minlength:5,
                },
                oldPassword:{
                    required: true,
                    remote: {
                        url: "<%=request.getContextPath()%>/admin/sys/user/inspectPwd",     //后台处理程序
                        type: "post",               //数据发送方式
                        dataType: "json",           //接受数据格式
                        data: {                     //要传递的数据
                            oldPassword: function () {
                                return $("#oldPassword").val();
                            },
                            userId: function () {
                                return $('#id').val();
                            }
                        }
                    }
                }
            },
            messages: {
                password:{
                    required: "请确认密码",
                    equalTo: "两次输入的密码不一致"
                },
                newPassword:{
                    required: "请输入密码"
                },
                oldPassword:{
                    required: "请输入原始密码",
                    remote:"原始密码输入错误"
                }
            }

        });


    });

</script>
<body>
<div id="div">
    <ul class="nav nav-tabs">
        <li ${param['search.deleted_eq'] ne 'true' and param['search.status_eq'] ne 'blocked' ? 'class="active"' : ''}>
            <a href="<%=request.getContextPath()%>/admin/sys/user/updatePassword">
                <i class="icon-table"></i>
                修改密码
            </a>
        </li>
        <!--style="float:right;width:10%"-->
        <li ${param['deleted'] eq 'true' ? 'class="active"' : ''}>
            <a href="<%=request.getContextPath()%>/admin/sys/user/uploadIcon">
                <i class="icon-table"></i>
                头像更换
            </a>
        </li>
    </ul>
    <es:showMessage/>
    <form id="editForm" action="<%=request.getContextPath()%>/admin/sys/user/updatePassword" method="post">
        <input type="hidden" value="${user.id}" name="id" id="id">
    <table class="table table-bordered">
        <tr style="background-color: darkgrey; font-size: 12px">
            <td colspan="4" style="color: wheat;">修改密码</td>
        </tr>
        <tr style=" font-size: 12px">
            <td>用户原始密码</td>
            <td width="70%">
                <input name="oldPassword" id="oldPassword" placeholder="旧密码" type="password" />
            </td>
        </tr>
        <tr style=" font-size: 12px">
            <td>用户新密码</td>
            <td>
                <input name="newPassword" type="password" id="newPassword" placeholder="新密码"/>
            </td>
        </tr>
        <tr style=" font-size: 12px">
            <td>确认新密码</td>
            <td>
                <input name="password" type="password" id="confirmPassword" placeholder="确认密码"/>
            </td>
        </tr>
        <tr style="font-size: 12px"  align="lef">
           <td colspan="2"> <input  type="submit" class="btn btn-primary" value=" 确认修改"/></td>
        </tr>
    </table>
    </form>
</div>
